fix(search): scroll only results#1548
Open
TGianella wants to merge 2 commits into
Open
Conversation
Contributor
|
c171a1e was deployed to: https://fred-pr1548.review.mdn.allizom.net/ |
Contributor
Author
|
Thanks for the review @LeoMcA and sorry for not checking on WebKit and wasting your time. To the best of my ability I could not find a solution that would fix the bug in all supported browsers while keeping the current grid layout and HTML structure. I pushed a new commit migrating the search modal to flexbox and updated the description of the PR accordingly, if you do not agree with the solution you can close this PR directly because I won't have a better solution. 🙂 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Migrate the search modal dialog from grid to flexbox layout and add a wrapper div around the search input and close button to keep the same UI in the new layout system.
Motivation
In the current grid layout,
min-contenton the search results row was causing the grid track to be as high as the wholeulcontaining the search results, so theulitself couldn't be a scroll container because its content wasn't overflowing its height. Hence the next parent (dialog) with a capped width became the scroll container and the whole dialog scrolled (with the input field).As @LeoMcA pointed out, the easy fix of using 1fr doesn't work on WebKit (because they have a different implementation of computing what 1fr means when there is no explicit height).
I could not find a solution which worked while keeping the grid layout so I propose to migrate to flexbox to resolve the issue on all browsers.
Warning
I tested on Firefox/Safari/Chrome both small and large breakpoints with empty search results, few results (not overflowing) and overflowing search results. With my limited knowledge about the search modal specs, I did not find any regression except that the close button on the dev server falls back to the text because the icon is not loaded, and in the new layout the text doesn't break and grows to take as much space as needed to render on one line:
This is a minor issue that only appears if the icon doesn't load.
Additional details
Related issues and pull requests
Closes #1474